Conversation
…add tests for all-optional warning and non-Int32 enum target-context round-trip The Logger static member was implemented as a computed property returning `ref None` on every access, making it impossible to set. Changed to a `static let loggerRef` field and made Logger return that shared ref. New tests added (Task 9): - 3 tests for the all-optional static parameters warning via ProvidedTypeDefinition.Logger - 2 tests that read non-Int32 enums back via TargetContext.ReadRelatedAssembly, exercising the TargetTypeDefinition.GetEnumUnderlyingType() path All 131 tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2 tasks
dsyme
approved these changes
Apr 13, 2026
dsyme
pushed a commit
that referenced
this pull request
Apr 17, 2026
….6.0 (#504) 🤖 *This is an automated PR from Repo Assist.* ## Summary **Task 9 – Testing Improvements**: Add `GenerativePropertiesTests.fs` with 5 new property tests for generative types. **Task 10 – Take the Repository Forward**: Update `RELEASE_NOTES.md` to prepare release 8.6.0. --- ## Changes ### New: `tests/GenerativePropertiesTests.fs` Five tests covering properties in generative type providers: 1. **Instance read-only property** – presence, type, `CanRead`/`CanWrite`, non-static getter 2. **Instance read-write property** – getter and setter present, correct method names 3. **Static read-only property** – presence, static getter 4. **Name-lookup for all properties** – calls `GetProperty` by name for each of the 4 properties on the generated type; directly exercises the `ILPropertyDefs` lazy `FindByName` dictionary added in #502 5. **Property count** – verifies the correct number of properties is emitted ### Updated: `RELEASE_NOTES.md` Added 8.6.0 entry documenting: - Bug fix: `ProvidedTypeDefinition.Logger` creating a new delegate reference on each call (#501) - Refactor/Performance: `ILFieldDefs`/`ILEventDefs`/`ILPropertyDefs` concrete classes with lazy O(1) name-lookup caches (#502) - These new tests --- ## Test Status ✅ **136/136 tests pass** (baseline was 131; 5 new tests added, all green) ``` Passed! - Failed: 0, Passed: 136, Skipped: 0, Total: 136 ``` > Generated by 🌈 Repo Assist, see [workflow run](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/24430249769). [Learn more](https://github.com/githubnext/agentics/blob/main/docs/repo-assist.md). > > To install this [agentic workflow](https://github.com/githubnext/agentics/blob/97143ac59cb3a13ef2a77581f929f06719c7402a/workflows/repo-assist.md), run > ``` > gh aw add githubnext/agentics@97143ac > ``` <!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, model: auto, id: 24430249769, workflow_id: repo-assist, run: https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/24430249769 --> <!-- gh-aw-workflow-id: repo-assist --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
dsyme
pushed a commit
that referenced
this pull request
Apr 20, 2026
…ase 8.7.0 (#506) 🤖 *This is an automated pull request from Repo Assist.* ## Summary Adds `GenerativeCustomAttributeTests.fs` — 5 regression tests for custom attribute encoding in the generative IL writer. These cover attribute targets and argument types not previously exercised by the existing tests in `BasicGenerativeProvisionTests.fs` (which only tested attributes on *properties*). Also updates `RELEASE_NOTES.md` with a new `8.7.0` entry covering this and the previously-merged `GenerativeMethodsTests` (#505). ## New tests | Test | What it verifies | |------|-----------------| | `Custom attribute on a generative type round-trips correctly` | `ObsoleteAttribute(string, bool)` placed on the *type definition itself* | | `Custom attribute with bool constructor argument round-trips correctly` | `bool` values survive the ECMA-335 encode/decode path | | `Custom attribute with enum constructor argument round-trips correctly` | `DebuggerBrowsableAttribute(DebuggerBrowsableState.Never)` — enum arg decoded as underlying int | | `Multiple custom attributes on a single generative method are all preserved` | `defineCustomAttrs` writes **all** attributes, not just the first | | `Custom attribute on a generative method has correct string argument` | `DescriptionAttribute(string)` on an instance method | ## Root cause / motivation Several custom-attribute encoding bugs were fixed in earlier PRs (`#432`, `#490`, `#501`). This PR adds focused regression tests for the remaining un-covered paths: - attributes on **types** (not just members) - attributes on **methods** (not just properties) - **bool** and **enum** constructor argument encoding - multiple attributes on a single member ## Test Status ``` Passed! - Failed: 0, Passed: 147, Skipped: 0, Total: 147, Duration: 7 s ``` All 147 tests pass (142 pre-existing + 5 new). > Generated by 🌈 Repo Assist, see [workflow run](https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/24617397828). [Learn more](https://github.com/githubnext/agentics/blob/main/docs/repo-assist.md). > > To install this [agentic workflow](https://github.com/githubnext/agentics/blob/97143ac59cb3a13ef2a77581f929f06719c7402a/workflows/repo-assist.md), run > ``` > gh aw add githubnext/agentics@97143ac > ``` <!-- gh-aw-agentic-workflow: Repo Assist, engine: copilot, model: auto, id: 24617397828, workflow_id: repo-assist, run: https://github.com/fsprojects/FSharp.TypeProviders.SDK/actions/runs/24617397828 --> <!-- gh-aw-workflow-id: repo-assist --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Summary
This PR bundles a bug fix and new tests (Task 9: Testing Improvements).
Bug fix:
ProvidedTypeDefinition.Loggerwas silently brokenThe static
Loggermember was implemented as a computed property:Every read of
ProvidedTypeDefinition.Loggerreturned a differentrefobject, so callingProvidedTypeDefinition.Logger := Some fwould write into a temporary cell that is immediately discarded. The Logger was effectively inoperative: the "all static parameters optional" warning (added in 8.3.0 / PR #428) could never fire via the Logger, and type-creation trace messages were silently dropped.Fix: introduces a
static let loggerReffield and makesLoggerreturn it:New tests (5 tests, 131 total)
BasicErasedProvisionTests.fs— 3 new tests for the all-optional warning:DefineStaticParameters warns when all static parameters have defaults— regression for the warning path (which was previously unreachable due to the Logger bug)DefineStaticParameters does not warn when at least one parameter has no defaultDefineStaticParameters does not warn when there are no static parametersGenerativeEnumsProvisionTests.fs— 2 new tests for non-Int32 enum round-trip via target context:Byte enum underlying type is correct when read via target context (ReadRelatedAssembly)— exercisesTargetTypeDefinition.GetEnumUnderlyingType()for abyte-backed enumInt64 enum underlying type is correct when read via target context (ReadRelatedAssembly)— same forint64-backed enumsThese complement the existing runtime-path enum tests (
Assembly.Load) by covering the design-time IL-reader path, which was fixed in PR #470/#475.Trade-offs
try/finally).Test Status
✅ All 131 tests pass (
dotnet test tests/FSharp.TypeProviders.SDK.Tests.fsproj -c Release)